package com.jiantong.user.service;

import com.jiantong.user.dto.InsertUserGov;
import com.jiantong.user.model.*;
import io.terminus.common.model.Response;

import java.util.List;
import java.util.Map;

public interface UserWriteService<T extends User> {

    /**
     * 创建新用户
     *
     * @param user 用户
     * @return 新用户id
     */
    Response<Long> create(T user);

    /**
     * 更新用户
     *
     * @param user 用户
     * @return 是否更新成功
     */
    Response<Boolean> update(T user);

    /**
     * 更新个人资料信息 养殖端
     * @param avatarMap    头像
     * @param realName  姓名
     * @param gender    性别
     * @param identityCardNumber    身份证
     * @param email                   邮箱
     * @param corporateCharterMap      公司执照
     * @return 是否更新成功,
     */
    Response<Boolean> updatePersonalData(Long id,Map<String , Map<String , String>> avatarMap,String realName,Integer gender,String identityCardNumber,String email,Map<String , Map<String , String>> corporateCharterMap);

    /**
     * 更新个人资料信息 政府端
     * @param avatarMap    头像
     * @param realName  姓名
     * @param gender    性别
     * @param identityCardNumber    身份证
     * @param email                   邮箱
     * @return 是否更新成功,
     */
    Response<Boolean> updatePersonalData(Long id,Map<String , Map<String , String>> avatarMap,String realName,Integer gender,String identityCardNumber,String email);


    Response<Boolean> createGov(User user, UserProfile userProfile, OrganizationUser organizationUser, DepartmentUser departmentUser,AppUserRole appUserRole,UserRole userRole);
    Response<Boolean> createOrganizationUserList(List<InsertUserGov> insertUserGovList);

    Response<Boolean> createFac(User user, UserProfile userProfile, OrganizationUser organizationUser);

    Response<Boolean> updateuser(User user, UserProfile userProfile, OrganizationUser organizationUser, DepartmentUser departmentUser);
}
